<template>
	<view class="pt70 bgtmert">
		<view class="pd">
			<view class="khjhnnderr row pl70 ">
				<view class="col fz30 cf">
					解锁控制面板
				</view>
				<switch :checked="isxzs"   @change="switchChange"/>
			</view>
		</view>
		<uni-list class="mt80">
			<uni-list-item title="更改密码" @tap="hf('resetpassword')"></uni-list-item>
		</uni-list>
		
	</view>
</template>
<script>
	export default {
		data() {
			return {
				isxzs: false,
				istype:0
			}
		},
		components: {
			
		},
		methods: {
			switchChange (e) {
				let value = e.target.value
				let that = this
				if (value) {
					this.dengljse()
				}else{
					if(this.istype == 1){
						uni.removeStorageSync('locks');
					}
				}
			},
			dengljse(){
				uni.navigateTo({
					url:'setpassword'
				})
			}
		},
		onShow() {
			let locks = uni.getStorageSync('locks')
			console.log(locks);
			this.istype = locks.type
			if(locks.type == 1){
				this.isxzs = true
			}
		},
		mounted() {
			
		}
	}
</script>
<style scoped>
	.khjhnnderr{
		height:140upx;
		line-height: 140upx;
		background:rgba(53,60,81,1);
		border-radius:12upx;
	}
</style>
